//
//  AppMainMenu.m
//  iPhoneControlApplication
//
//  Created by Elliot Chapple on 11/04/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "AppMainMenu.h"
#import "Constants.h"



@implementation AppMainMenu

//synth objects

@synthesize		videoControlMM;
@synthesize		audioControlMM;
@synthesize		televisionControlMM;
@synthesize		radioControlMM;
@synthesize		lightsControlMM;
@synthesize		temperatureConrolMM;
@synthesize		garageDoorMM;
@synthesize		blindsControlMM;
@synthesize		securityControlMM;
//Help & Settings NIBs (x1)
@synthesize		helpAndSettingsMM;


-(IBAction)buttonPress
{
}


//Apple standard code

/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
	if (kFirstUseNotifier == 0)
	{
		NSString *newText = [[NSString alloc] initWithFormat:@"This is your first time running the application. Please visit the settings page in order to set up the application"];
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"First Run" message:newText delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
		
		//to try and update the constant value after first use.
		//NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
		//[defaults setObject:(int)1 forKey:kFirstUseNotifier];
		
		[alert show];
		[alert release];
		//kFirstUseNotifier = 1;
		[newText release];
	}
	else {
		NSString *newText = [[NSString alloc] initWithFormat:@"This application is now simulating control of a number of home centric devices"];
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Connection Established" message:newText delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
		[alert show];
		[alert release];
		[newText release];
	}
	
}

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
    [super dealloc];
}


@end
